package logic

import (
	"context"

	"beaver/app/dictionary/dictionary_rpc/internal/svc"
	"beaver/app/dictionary/dictionary_rpc/types/dictionary_rpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetCitiesLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewGetCitiesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCitiesLogic {
	return &GetCitiesLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 获取城市列表
func (l *GetCitiesLogic) GetCities(in *dictionary_rpc.GetCitiesReq) (*dictionary_rpc.GetCitiesRes, error) {
	// 模拟城市数据，实际应该从数据库或缓存获取
	cities := []*dictionary_rpc.CityInfo{
		{CityId: "0372", CityName: "安阳"},
		{CityId: "0472", CityName: "包头"},
		{CityId: "0312", CityName: "保定"},
		{CityId: "0917", CityName: "宝鸡"},
		{CityId: "010", CityName: "北京"},
		{CityId: "0543", CityName: "滨州"},
		{CityId: "0317", CityName: "沧州"},
		{CityId: "0736", CityName: "常德"},
		{CityId: "05127", CityName: "常熟"},
		{CityId: "0519", CityName: "常州"},
		{CityId: "0431", CityName: "长春"},
		{CityId: "0731", CityName: "长沙"},
		{CityId: "0735", CityName: "郴州"},
		{CityId: "028", CityName: "成都"},
		{CityId: "0411", CityName: "大连"},
		{CityId: "0459", CityName: "大庆"},
		{CityId: "0838", CityName: "德阳"},
		{CityId: "0534", CityName: "德州"},
		{CityId: "0546", CityName: "东营"},
		{CityId: "0769", CityName: "东莞"},
		{CityId: "0477", CityName: "鄂尔多斯"},
		{CityId: "0757", CityName: "佛山"},
		{CityId: "0591", CityName: "福州"},
		{CityId: "0797", CityName: "赣州"},
		{CityId: "0102", CityName: "公益"},
		{CityId: "020", CityName: "广州"},
		{CityId: "0851", CityName: "贵阳"},
		{CityId: "0451", CityName: "哈尔滨"},
		{CityId: "0898", CityName: "海口"},
		{CityId: "330481", CityName: "海宁"},
		{CityId: "0310", CityName: "邯郸"},
		{CityId: "0571", CityName: "杭州"},
		{CityId: "0530", CityName: "菏泽"},
		{CityId: "0551", CityName: "合肥"},
		{CityId: "0734", CityName: "衡阳"},
		{CityId: "0471", CityName: "呼和浩特"},
		{CityId: "0572", CityName: "湖州"},
		{CityId: "0517", CityName: "淮安"},
		{CityId: "0713", CityName: "黄冈"},
		{CityId: "0752", CityName: "惠州"},
		{CityId: "0531", CityName: "济南"},
		{CityId: "0537", CityName: "济宁"},
		{CityId: "0573", CityName: "嘉兴"},
		{CityId: "0750", CityName: "江门"},
		{CityId: "05108", CityName: "江阴"},
		{CityId: "0391", CityName: "焦作"},
		{CityId: "0663", CityName: "揭阳"},
		{CityId: "0579", CityName: "金华"},
		{CityId: "0716", CityName: "荆州"},
		{CityId: "0792", CityName: "九江"},
		{CityId: "0378", CityName: "开封"},
		{CityId: "0871", CityName: "昆明"},
		{CityId: "0931", CityName: "兰州"},
		{CityId: "03161", CityName: "廊坊"},
		{CityId: "330382", CityName: "乐清"},
		{CityId: "0518", CityName: "连云港"},
		{CityId: "0635", CityName: "聊城"},
		{CityId: "0539", CityName: "临沂"},
		{CityId: "0772", CityName: "柳州"},
		{CityId: "0379", CityName: "洛阳"},
		{CityId: "0555", CityName: "马鞍山"},
		{CityId: "0668", CityName: "茂名"},
		{CityId: "0816", CityName: "绵阳"},
		{CityId: "0791", CityName: "南昌"},
		{CityId: "0817", CityName: "南充"},
		{CityId: "025", CityName: "南京"},
		{CityId: "0771", CityName: "南宁"},
		{CityId: "0513", CityName: "南通"},
		{CityId: "0377", CityName: "南阳"},
		{CityId: "0574", CityName: "宁波"},
		{CityId: "0375", CityName: "平顶山"},
		{CityId: "0532", CityName: "青岛"},
		{CityId: "0595", CityName: "泉州"},
		{CityId: "0101", CityName: "全国"},
		{CityId: "0633", CityName: "日照"},
		{CityId: "330381", CityName: "瑞安"},
		{CityId: "0754", CityName: "汕头"},
		{CityId: "021", CityName: "上海"},
		{CityId: "0575", CityName: "绍兴"},
		{CityId: "0755", CityName: "深圳"},
		{CityId: "024", CityName: "沈阳"},
		{CityId: "0719", CityName: "十堰"},
		{CityId: "0311", CityName: "石家庄"},
		{CityId: "0512", CityName: "苏州"},
		{CityId: "0527", CityName: "宿迁"},
		{CityId: "0576", CityName: "台州"},
		{CityId: "0538", CityName: "泰安"},
		{CityId: "321283", CityName: "泰兴"},
		{CityId: "0523", CityName: "泰州"},
		{CityId: "320585", CityName: "太仓"},
		{CityId: "0351", CityName: "太原"},
		{CityId: "0315", CityName: "唐山"},
		{CityId: "022", CityName: "天津"},
		{CityId: "330483", CityName: "桐乡"},
		{CityId: "0631", CityName: "威海"},
		{CityId: "0536", CityName: "潍坊"},
		{CityId: "0577", CityName: "温州"},
		{CityId: "0991", CityName: "乌鲁木齐"},
		{CityId: "0510", CityName: "无锡"},
		{CityId: "0553", CityName: "芜湖"},
		{CityId: "027", CityName: "武汉"},
		{CityId: "029", CityName: "西安"},
		{CityId: "0971", CityName: "西宁"},
		{CityId: "0592", CityName: "厦门"},
		{CityId: "0293", CityName: "咸阳"},
		{CityId: "00852", CityName: "香港"},
		{CityId: "0710", CityName: "襄阳"},
		{CityId: "07315", CityName: "湘潭"},
		{CityId: "0373", CityName: "新乡"},
		{CityId: "0516", CityName: "徐州"},
		{CityId: "0374", CityName: "许昌"},
		{CityId: "0535", CityName: "烟台"},
		{CityId: "0515", CityName: "盐城"},
		{CityId: "0514", CityName: "扬州"},
		{CityId: "0831", CityName: "宜宾"},
		{CityId: "0717", CityName: "宜昌"},
		{CityId: "330782", CityName: "义乌"},
		{CityId: "0951", CityName: "银川"},
		{CityId: "0912", CityName: "榆林"},
		{CityId: "330281", CityName: "余姚"},
		{CityId: "0730", CityName: "岳阳"},
		{CityId: "02501", CityName: "悦享读"},
		{CityId: "0632", CityName: "枣庄"},
		{CityId: "0759", CityName: "湛江"},
		{CityId: "0596", CityName: "漳州"},
		{CityId: "05126", CityName: "张家港"},
		{CityId: "0758", CityName: "肇庆"},
		{CityId: "0511", CityName: "镇江"},
		{CityId: "0371", CityName: "郑州"},
		{CityId: "0760", CityName: "中山"},
		{CityId: "023", CityName: "重庆"},
		{CityId: "0756", CityName: "珠海"},
		{CityId: "07312", CityName: "株洲"},
		{CityId: "330681", CityName: "诸暨"},
		{CityId: "0533", CityName: "淄博"},
		{CityId: "08512", CityName: "遵义"},
	}
	return &dictionary_rpc.GetCitiesRes{
		Cities: cities,
	}, nil
}
